/*
var refugie=function()
	var IdRefugie;
	var Nom;
	var Age;	
	var Ville;
	var Pays;
	var IdCamp;
*/	


/*
var camp=function()
	var IdCamp;
	var Nom;
	var Coordonnees;
	var Pays;
	var Capacite;
	var Phone;
*/	


/*var personnel=
	var IdPersonnel;
	var Nom;
	var IdCamp;
	var Login;
	var Mdp;
	*/


//INIT 
var refugies = [];
for (i = 0; i < 100; i++) { 
	refugies.push(["R"+(i+1),chance.name(),chance.age(),chance.city(),"pays","C"+1+(i%4)]);
}


var camps = [];
for (i = 0; i < 10; i++) { 
	camps.push(["C"+(i+1),chance.name(),chance.coordinates(),"pays",chance.natural({min: 100, max: 2000}),chance.phone()]);
}

var personnels= [];
for (i = 0; i < 25; i++) { 
	personnels.push(["P"+(i+1),chance.name(),"C"+1+(i%4),"adminP"+(i+1), "adminP"+(i+1)]);
}

//CONTROLEURS REFUGIES

var getNomRefugieById=function($id){
	for(i = 0 ; i< refugies.length ; i++){
		if(refugies[i][0]==$id)
			return refugies[i][1];
	}
};
var getAgeRefugieById=function($id){
	for(i = 0 ; i< refugies.length ; i++){
		if(refugies[i][0]==$id)
			return refugies[i][2];
	}
};
var getVilleRefugieById=function($id){
	for(i = 0 ; i< refugies.length ; i++){
		if(refugies[i][0]==$id)
			return refugies[i][3];
	}
};
var getPaysRefugieById=function($id){
	for(i = 0 ; i< refugies.length ; i++){
		if(refugies[i][0]==$id)
			return refugies[i][4];
	}
};
var getIDCampRefugieById=function($id){
	for(i = 0 ; i< refugies.length ; i++){
		if(refugies[i][0]==$id)
			return refugies[i][5];
	}
};

//CONTROLEURS CAMPS

var getNomCampById=function($id){
	for(i = 0 ; i< camps.length ; i++){
		if(camps[i][0]==$id)
			return camps[i][1];
	}
};
var getCampCoordonneesById=function($id){
	for(i = 0 ; i< camps.length ; i++){
		if(camps[i][0]==$id)
			return camps[i][2];
	}
};
var getPaysCampById=function($id){
	for(i = 0 ; i< camps.length ; i++){
		if(camps[i][0]==$id)
			return camps[i][3];
	}
};
var getCapaciteCampById=function($id){
	for(i = 0 ; i< camps.length ; i++){
		if(camps[i][0]==$id)
			return camps[i][4];
	}
};
var getPhoneCampById=function($id){
	for(i = 0 ; i< camps.length ; i++){
		if(camps[i][0]==$id)
			return camps[i][5];
	}
};

//CONTROLEURS PERSONNELS

var getNomPersonnelById=function($id){
	for(i = 0 ; i< personnels.length ; i++){
		if(personnels[i][0]==$id)
			return personnels[i][1];
	}
};
var getIDCampPersonnelById=function($id){
	for(i = 0 ; i< personnels.length ; i++){
		if(personnels[i][0]==$id)
			return personnels[i][2];
	}
};
var getLoginPersonnelById=function($id){
	for(i = 0 ; i< personnels.length ; i++){
		if(personnels[i][0]==$id)
			return personnels[i][3];
	}
};
var getMdpPersonnelById=function($id){
	for(i = 0 ; i< personnels.length ; i++){
		if(personnels[i][0]==$id)
			return personnels[i][4];
	}
};

/*
var ff="";
for (i = 0; i < camps.length; i++) { 
	ff+=camps[i]+"<br>";
	
}
for (i = 0; i < refugies.length; i++) { 
	ff+=refugies[i]+"<br>";
	
}
for (i = 0; i < personnels.length; i++) { 
	ff+=personnels[i]+"<br>";
	
}

$("body").html(ff);
*/
